package com.emex.app.web.service;

import com.emex.app.shared.data.CostType;
import com.emex.app.shared.data.CostTypeExample;
import com.emex.app.shared.persistance.CostTypeMapper;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @author Sergey Karavaev
 */
@Service
@Transactional
public class CostTypeService {

    @Autowired
    private CostTypeMapper costTypeMapper;

    public int deleteCostTypeByPrimaryKey(Integer id) {
        return costTypeMapper.deleteByPrimaryKey(id);
    }

    public CostType insertCostType(CostType record) {
        costTypeMapper.insert(record);
        return record;
    }

    public List<CostType> selectCostTypeByExample(CostTypeExample example) {
        return costTypeMapper.selectByExample(example);
    }

    public List<CostType> getAllCostTypes() {
        return selectCostTypeByExample(null);
    }

    public CostType updateCostType(CostType record) {
        costTypeMapper.updateByPrimaryKey(record);
        return record;
    }

    public CostType selectCostTypeByPrimaryKey(Integer id) {
        return costTypeMapper.selectByPrimaryKey(id);
    }
}
